import EventCenter, { ZPacket } from "../NetIO/EventIO";
import MysqlAuto from "../Mysql/MySqlAuto"


/*===================================================
客户端进入游戏先登录账号, 获得UIN以及MD5KEY, 后续通讯需要MD5验证权限
用户的账号登陆相关服务
===================================================*/

enum PACK_CMD_ACC{
    PCA_LOGIN,
}

export default class AccountCenter{
    
    public m_pDB:MysqlAuto = null;
    public constructor(){
        EventCenter.getInstance().RegPacketListen("zacc",this.RecvPacket)

        this.m_pDB  = new MysqlAuto("z_account");
        this.m_pDB.InitTable();
    }

    public RecvPacket(pP:ZPacket){
        switch(pP.nCmd){
            case PACK_CMD_ACC.PCA_LOGIN:{
                pP.vParams;


            }
            return;
        }
        console.log("RecvPacket=="+pP.vParams.length);
        pP.pClient.write("AccountCenter");//JSON.stringify(p));
        pP.pClient.write("RecvPacket");//JSON.stringify(p));
        pP.pClient.end();
    }



}